<template>
  <el-form :model="form" ref="form" label-width="100px" label-position="right" :rules="rules">
    <el-form-item prop="name">
      <el-input v-model="form.name"></el-input>
    </el-form-item>
    <el-button @click="getMenus">reset</el-button>
  </el-form>
</template>
<script lang="ts">
  import { Vue, Component } from 'vue-property-decorator'

  @Component
  export default class A extends Vue {
    form = {
      name: ''
    }
    rules = {
      name: [
        {required: true}
      ]
    }
    async getMenus () {
      let res: AjaxResponse = await this.$axios('b/boms/menu/menus')
      this.$utils.tips(res)
    }
    c () {
      this.$refs.form.resetFields()
    }

    mounted () {
      this.form.name = '3'
      this.getMenus()
      this.getMenus()
    }
  }
</script>
